<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>class定义类</title>
</head>
<body>
    <script>
        "use strict"
        class Person
        {
            //构造方法
            constructor(name,age,height)
            {
                this._name = name;
                this._age = age;
                this._height = height; 
            }
            
            //实例化方法
            running()
            {
                console.log("跑步");
            }

            //静态方法
            static eat()
            {
                console.log("吃饭");
            }
        }

        var p1 = new Person("cq",18,1.88);
        console.log(p1._name,p1._age,p1._height);
        p1.running();
        Person.eat();
    </script>
</body>
</html>